package org.dlust.ioc;

import org.dlust.ioc.test.Beer;
import org.dlust.ioc.test.Student;
import org.dom4j.DocumentException;

public class App {
  public static void main(String[] args) throws DocumentException, ClassNotFoundException {
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
    Beer beer = (Beer) ctx.getBean("Beer");
    beer.setBeerName("Bai Wei");
    System.out.println(beer.getBeerName());

    Student student = (Student) ctx.getBean("Student");
    student.setName("周杰伦");
    System.out.println(student.getName());
  }
}
